The present invention relates generally to circuitry for converting an analog signal to a PWM signal, and more specifically to such circuitry operable to produce the PWM signal based on detection of peaks and valleys in the analog signal.
Many circuit applications are known to exist that require determination of the frequency of an analog signal. In the automotive industry, for example, engine and/or vehicle operation sensors typically produce analog signals that are used by one or more on-board processors to control various aspects of engine and/or vehicle operation. In some cases, the information needed from the analog signal is its operating frequency, which may vary with engine/vehicle operation. One typical example of such a sensor is a rotational speed sensor, such as a wheel speed sensor, which produces an analog speed signal having a frequency that varies as a function of the rotational speed of a rotating component.
One commonly employed technique for determining the frequency of an analog signal requires first converting the analog signal to a digital signal, and then processing the converted digital signal in a known manner to determine its frequency. Such a technique is commonly employed in systems that include a microprocessor, particularly since microprocessors are typically equipped with a number of analog-to-digital (A/D) inputs operable to convert analog signals to digital signals for further processing by the microprocessor.
A number of systems are known to exist that require determination of the frequency of an analog signal, but which either do not have an available A/D microprocessor input or do not have microprocessor at all. While an A/D circuit may be implemented in such systems to convert the analog signal to a corresponding digital signal, such circuits may be cost prohibitive in many applications. Heretofore, a number of non-A/D based circuits have accordingly been developed to convert the analog signal to a pulse width modulated (PWM) signal having a frequency proportional to the frequency of the analog signal. For example, one conventional signal converting circuit is configured to compare the amplitude of the analog signal to a fixed threshold level or levels established near the signal reference level. Another known signal converting circuit is configured to compare the amplitude of the analog signal to a threshold level defined by the signal reference level itself. In both cases, a comparator is typically employed to switch between two different signal levels each time the analog signal crosses the established threshold to produce a pulse width modulated (PWM) output signal having a frequency proportional to the frequency of the analog signal.
One drawback associated with each of the foregoing techniques for converting an analog signal to a PWM signal is that each requires comparison of the analog signal to a fixed threshold at, or near, the signal reference. If the analog signal exhibits an offset sufficiently above or below the fixed threshold, some threshold crossings may not be detected, and inaccurate frequency measurements may accordingly result.
What is therefore needed is a circuit configured to accurately produce a PWM signal defining a frequency proportional to that of an analog signal having both a frequency and amplitude that may vary widely, such that an accurate determination of the frequency of the analog signal may thereafter be made.
The foregoing shortcomings of the prior art are addressed by the present invention. In accordance with one aspect of the present invention, circuitry for converting an analog signal to a PWM signal comprises a first circuit configured to sample an amplitude of the analog signal at a first rate and produce a first signal corresponding thereto, a second circuit configured to sample the amplitude of the analog signal at a second rate slower than the first rate and produce a second signal corresponding thereto, a third circuit producing a third signal defining a first state when the first signal is greater than the second signal and otherwise defining a second opposite state, and a fourth circuit producing the PWM signal defining a pulse width as a function of a switching rate of the third signal between the first and second states.
In accordance with another aspect of the present invention, circuitry for converting an analog signal to a PWM signal comprises a sampling circuit configured to sample an amplitude of the analog signal at two different rates and produce corresponding first and second signals, a comparison circuit producing a comparison signal defining a first state when the first signal is greater than the second signal and otherwise defining a second opposite state, and a delay circuit producing the PWM signal as a function of the comparison signal and a control signal, the PWM signal switching from a first signal level to a second signal level when the comparison signal switches from the first state to the second state only if the comparison signal thereafter remains in the second state for a delay period defined by the control signal, and the PWM signal switching from the second signal level to the first signal level when the comparison signal switches from the second state to the first state only if the comparison signal thereafter remains in the first state for the delay period.
In accordance with a further aspect of the present invention, circuitry for converting an analog signal to a PWM signal comprises a sampling circuit configured to sample an amplitude of the analog signal and produce a detection signal defining a first state upon detection of a peak in the amplitude of the analog signal, and defining a second opposite state upon detection of a valley in the amplitude of the analog signal, and a delay circuit producing the PWM signal as a function of the detection signal and a control signal, the PWM signal switching from a first signal level to a second signal level when the detection signal switches from the first state to the second state only if the detection signal thereafter remains in the second state for a delay period defined by the control signal, and the PWM signal switching from the second signal level to the first signal level when the detection signal switches from the second state to the first state only if the detection signal thereafter remains in the first state for the delay period.
The present invention provides a circuit for accurately converting an analog signal to a PWM signal even though the amplitude and/or the frequency of the analog signal may vary widely.
The present invention further provides such a circuit operable to accurately convert an analog signal to a PWM signal for further processing by a signal processing circuit operable to process the PWM signal to determine therefrom the frequency of the analog signal.
These and other objects of the present invention will become more apparent from the following description of the preferred embodiment.